package cn.yuxiaoyuan.service.impl;

import cn.hutool.crypto.SecureUtil;
import cn.yuxiaoyuan.common.util.R;
import cn.yuxiaoyuan.common.util.RandomStringUtils;
import cn.yuxiaoyuan.mapper.EmployeeMapper;
import cn.yuxiaoyuan.mapper.UserMapper;
import cn.yuxiaoyuan.service.IEmployeeService;
import cn.yuxiaoyuan.service.IUserService;
import cn.yuxiaoyuan.service.base.impl.BaseServiceImpl;
import cn.yuxiaoyuan.system.domain.Employee;
import cn.yuxiaoyuan.system.query.EmployeeQuery;
import cn.yuxiaoyuan.user.domain.User;
import cn.yuxiaoyuan.user.query.UserQuery;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author solargen
 * @version 1.0
 * @date 2025/5/11 10:36
 */
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Override
    public R pageList(EmployeeQuery employeeQuery) {
        PageHelper.startPage(employeeQuery.getPage(),employeeQuery.getSize());//自动在后面的哪个sql里面加上limit
        List<Employee> users = employeeMapper.pageList(employeeQuery);//在执行这个sql之前
        return  R.ok(new PageInfo<>(users));
    }
}
